<template>
  <h1>主界面</h1>


</template>

<script lang="ts" setup>

import { onMounted, ref } from 'vue';
import { autoLoginAPI } from '@/service/API';
import { useStore } from 'vuex';

const store = useStore();

const checkLogin = () => {
  autoLoginAPI(store)
}

onMounted(() => {
  const isFirstVisit = !sessionStorage.getItem('first');

  if (isFirstVisit) {
    // 设置 first，标记用户已访问过
    sessionStorage.setItem('first', 'true');

    // 首次访问时调用 checkLogin
    checkLogin();
  }
});

</script>

<style scoped></style>